package com.hxfeng.authdemo.controller;


import com.hxfeng.authdemo.entity.User;
import com.hxfeng.authdemo.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author hxfeng
 * @since 2022-05-18
 */
@RestController
@RequestMapping("/authdemo/user")
public class UserController {
    @Autowired
    IUserService userService;

    @RequestMapping("register")
    public String adduser(User user) {
        userService.addUser(user);
        return "success";
    }

    @RequestMapping("test")
    public String test(User user) {
        return "test";
    }
}
